package com.lxk.concurrency.example.publish;

import com.lxk.concurrency.annoations.NotThreadSafe;

@NotThreadSafe
public class Escape {

	private int thisCanBeEscape = 0;

	public Escape() {

		// 相当于启动了一个线程
		new InnerClass();
	}

	private class InnerClass {
		public InnerClass() {

			// 有可能在 Escape 完成构造初始化前，就被发布了
			System.out.println(Escape.this.thisCanBeEscape);
		}
	}

	public static void main(String[] args) {
		new Escape();
	}
}
